/*
 * Amendment History:
 * 
 * Date       By         Description 
 * ----------------------------------------------- 
 * Feb 1, 2010 Anselm Hou    Create the class
 */
package com.inibb.app.util.ioc.i18n;

import java.util.Collection;
import java.util.HashSet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ResourceBundleMessageSource;


/**
 * This class is created on Feb 1, 2010 
 * 
 * @author anselm
 * @since  Feb 1, 2010
 * @version 1.0
 */
public class ExtendedMessageSource extends ResourceBundleMessageSource
{
	private Logger log = LoggerFactory.getLogger(this.getClass());
	private final HashSet<String> currentSet=new HashSet<String>();

	public void addMessageBundles(Collection<String> messageBundles)
	{
		getCurrentSet().addAll(messageBundles);
		log.debug("Add message bundle,"+messageBundles+", currentSet:"+getCurrentSet());
		String[] strA=(String[]) getCurrentSet().toArray(new String[getCurrentSet().size()]);
		setBasenames(strA);
	}

	/**
	 * @return the value for currentSet
	 */
	public HashSet<String> getCurrentSet()
	{
		return currentSet;
	}
}
